package com.hjwoo.app.views;

import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.TextView;

import com.hjwoo.app.R;
import com.hjwoo.app.baseviews.BaseAppCompatActivity;
import com.hjwoo.app.utils.Utils;

/**
 * Create by ：rxiaowen on 2016/8/3
 * 携带资料
 */
public class DatumActivity extends BaseAppCompatActivity
{
    private TextView show_tv_add;
    private TextView tv_add;
    private TextView tv_des;

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_text);
        Utils.initTitle("面审材料", this, true);
        show_tv_add = (TextView) findViewById(R.id.show_tv_add);
        tv_add = (TextView) findViewById(R.id.tv_add);
        tv_des = (TextView) findViewById(R.id.tv_des);
        findViewById(R.id.btnBack).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        if (getIntent().getStringExtra("description") != null)
        {
//           B类客户设置附加材料
            tv_add.setVisibility(View.VISIBLE);
            show_tv_add.setVisibility(View.VISIBLE);
            tv_des.setVisibility(View.GONE);
            show_tv_add.setText("        " +  getIntent().getStringExtra("description"));
        }else{
            tv_add.setVisibility(View.GONE);
            show_tv_add.setVisibility(View.GONE);
        }
    }
    //监听手机返回键
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK ){
            finish();
        }
        return super.onKeyDown(keyCode, event);
    }
}
